<template>
<aside class="col-md-4 blog-aside">
                    
                    <div class="aside-widget">
                        <header>
                            <h3>最新文章</h3>
                        </header>
                        <div class="body">
                            <ul class="clean-list" v-for="data in datas_latest">
                                <li><RouterLink :to="'/article/'+data.id">{{ data.title }}</RouterLink></li>
                            </ul>
                        </div>
                    </div>
</aside>

</template>

<script setup>
import {ref,onMounted,getCurrentInstance} from "vue"

const {proxy} = getCurrentInstance()
const datas_latest = ref([])

onMounted(()=>{
    // 获取最新文章
    proxy.$http.get("/article?page=1").then(res=>{
        datas_latest.value = res.data.datas
    })

})

</script>